import request from '@/utils/request'

export function getAreaTree(params) {
    return request({
        url: 'api/sys/area/getTree',
        method: 'get',
        params
    })
}

export function findAll(ids) {
    const data = ids instanceof Array ? ids : Array.of(ids)
    return request({
        url: 'api/sys/area/findAll',
        method: 'post',
        data
    })
}

export function add(data) {
    return request({
        url: 'api/area',
        method: 'post',
        data
    })
}

export function del(ids) {
    return request({
        url: 'api/area',
        method: 'delete',
        data: ids
    })
}

export function edit(data) {
    return request({
        url: 'api/area',
        method: 'put',
        data
    })
}

export default { add, edit, del, getAreaTree, findAll }